package com.youkeyi.ddy.cloud.common.api.application.business.storage.in;

import com.youkeyi.ddy.cloud.common.api.application.business.storage.in.dto.BusinessStockInListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.in.param.BusinessStockInCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.in.param.BusinessStockInListCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统入库
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Stock In management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessStockInCloudServiceFallback.class)
@RequestMapping("/business/stock/in")
public interface BusinessStockInCloudService {

    // 查询入库列表
    @ApiOperation(value = "Query Business Stock In List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.in.BusinessStockInCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessStockInListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Business Stock In List", dataType = "BusinessStockInListCloudParam", dataTypeClass = BusinessStockInListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessStockInListCloudDto list(BusinessStockInListCloudParam param);

    // 创建入库
    @ApiOperation(value = "Create Business Stock In", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.in.BusinessStockInCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Business Stock In", dataType = "BusinessStockInCreateCloudParam", dataTypeClass = BusinessStockInCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessStockInCreateCloudParam param);

}
